﻿namespace EasyWeb.Data.EntityFramework
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.Composition;
    using System.Threading.Tasks;
    using EasyWeb.Data.EntityFramework.Models;

    [Export(typeof(IEWCultureDao))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public class EWCultureDao : EWDao, IEWCultureDao
    {
        public virtual async Task<IEnumerable<EWCultureInfo>> SelectAsync()
        {
            using (var transaction = EWHelpers.Data.BeginTransaction())
            {
                var result = await SelectCoreAsync<EWCultureInfo, EWCultureModel>();

                transaction.Complete();

                return result;
            }
        }
    }
}
